import 'bean_problem.dart';

/// 创建人： Created by zhaoint
/// 创建时间：Created by  on 2020/12/13.
///
/// 可关注公众号：我的大前端生涯   获取最新技术分享
/// 可关注网易云课堂：https://study.163.com/instructor/1021406098.htm
/// 可关注博客：https://blog.csdn.net/zl18603543572
///
/// 代码清单
///代码清单

class ProblemEndModel {
  /// questionNumber : 5.0
  /// totalScore : 1000.0
  /// obtainScore : 400.0
  /// rightAnswerNumber : 2.0
  /// answerTime : 13.0
  /// passPractice : N
  /// categoryOne : COAL_MINE_SAFETY
  /// categoryTwo : ANQUAN_JIANCHA
  /// userId : 3.0
  /// mineId : 1.0
  /// createTime : 2018-11-05 20:14:36

  int questionNumber;
  int totalScore;
  int obtainScore;
  int extryScore = 1;
  int rightAnswerNumber;

  int answerTime;
  String passPractice;
  String categoryOne;
  String categoryTwo;

  int userId;
  int mineId;
  String createTime;

  //获取的积分
  int getIntegral;

  List<ProblemModel> questionAnswers;

  ProblemEndModel.fromJson(Map<String, dynamic> map) {
    this.questionNumber = map["questionNumber"];
    this.totalScore = map["totalScore"];
    this.obtainScore = map["obtainScore"] ?? 0;
    this.extryScore = map["extryScore"] ?? 1;

    this.rightAnswerNumber = map["rightAnswerNumber"];

    this.answerTime = map["answerTime"];
    this.passPractice = map["passPractice"];
    this.categoryOne = map["categoryOne"];
    this.categoryTwo = map["categoryTwo"];

    List errList = map["questionAnswers"];

    if (errList != null) {
      questionAnswers = [];
      errList.forEach((element) {
        questionAnswers.add(ProblemModel.fromJson(element));
      });
    }
  }
}
